10 ;›20 ;   *** DUNGEONLORDS ***›30 ;       (Revision B)›40 ;›50 ; By Brian Douglas Bradley›60 ;      August 1, 1986›70 ;›80 ;        VARIABLES:›90 ;        ---------›0100 ;›0110 LOA       =128›0120 HIA       =129›0130 LO        =130›0140 HI        =131›0150 LOC       =132›0160 HIC       =133›0170 V1        =134›0180 V2        =135›0190 V3        =136›0200 V4        =137›0210 V5        =138›0220 V6        =139›0230 V7        =140›0240 V8        =141›0250 V9        =142›0260 XCL       =143›0270 YRW       =144›0280 CLX       =145›0290 RWY       =146›0300 XPOS      =147›0310 YPOS      =148›0320 MNX       =149›0330 MNY       =150›0340 MNXA      =151›0350 MNYA      =152›0360 STK       =153›0370 STK1      =154›0380 TRGR      =155›0390 MVE       =156›0400 GX1       =157›0410 GY1       =158›0420 GX2       =159›0430 GY2       =160›0440 BLTX      =161›0450 BLTY      =162›0460 BLTXY     =163›0470 TXY       =164›0480 JUMP      =165›0490 CNTR      =166›0500 XCNT      =167›0510 TIMES     =168›0520 SPEED     =169›0530 PLAY      =170›0540 SNGX      =171›0550 SPOT      =172›0560 SPOT2     =173›0570 OVER      =174›0580 KEY       =175›0590 SHOMN     =176›0600 LVL       =177›0610 LIVES     =178›0620 NOW       =179›0630 DLO       =182›0640 DHI       =183›0650 BDX       =184›0660 BDY       =216›0670 BDXY      =1536›0680 BDG       =1568›0690 ALV       =1600›0700 DLIST     =12212›0710 SCRS      =14478›0720 SYSVBV    =58463›0730 SEVBV     =58460›0740 ;›0750 ; INITIALIZE PROGRAM›0760 ;›0770  *= 8775›0780  .BYTE 112,112,112,112,112,71›0790  .BYTE 102,34,70,122,34,112›0800  .BYTE 112,71,162,34,70,142›0810  .BYTE 34,112,112,112,70,182›0820  .BYTE 34,70,0,57,65,71,34›0830  .BYTE "    dungeonlords    "›0840  .BYTE "  by brian bradley  "›0850  .BYTE " press start to play"›0860  .BYTE "      збне пцет     "›0870  .BYTE "        угпте       "›0880  LDA # 0›0890  LDX # 0›0900 RPT›0910  LDY # 0›0920 RPTA›0930  STA $3900,Y›0940  INY›0950  CPY # 0›0960  BNE RPTA›0970  INC RPTA+2›0980  INX›0990  CPX # 16›1000  BNE RPT›1010  LDA # 56›1020  STA 54279›1030  LDA # 126›1040  STA 559›1050  LDA # 3›1060  STA 53277›1070  STA 53775›1080  LDA # 0›1090  STA 712›1100  LDY # 0›1110 STR›1120  STA 128,Y›1130  INY›1140  CPY # 128›1150  BNE STR›1160  LDA # 8›1170  STA 706›1180  LDA # 119›1190  STA 53248›1200  STA 53249›1210  STA 53250›1220  JSR INT›1230  LDA # 212›1240  STA 704›1250  STA 710›1260 STRT›1270  LDA # 224›1280  STA 756›1290  LDA # 0›1300  STA 708›1310  STA 711›1320  LDA # 71›1330  STA 560›1340  LDA # 70›1350  STA 705›1360  STA 709›1370  LDA # 34›1380  STA 561›1390 SRT›1400  LDA 53279›1410  CMP # 6›1420  BNE SRT›1430  LDA # 250›1440  STA 711›1450  LDA # 48›1460  STA 756›1470  LDA # 180›1480  STA 560›1490  LDA # 47›1500  STA 561›1510  LDA # 1›1520  STA LVL›1530  JSR LP›1540  JMP STRT›1550 ;›1560 ; Display remaining lives›1570 ; and clear away all monsters›1580 ;›1590 ITA›1600  JSR ITF›1610  JMP ITE›1620 ITF›1630  LDX # 1›1640  LDA # 55›1650 ITB›1660  SEC›1670  CPX LIVES›1680  BCC ITC›1690  LDA # 0›1700 ITC›1710  STA SCRS-10,X›1720  INX›1730  CPX # 8›1740  BNE ITB›1750  RTS›1760 ITE›1770  LDX # 0›1780  LDA # 0›1790  STA OVER›1800 IT›1810  STA BDG,X›1820  LDA ALV,X›1830  CMP # 0›1840  BEQ ITD›1850  LDA BDX,X›1860  STA XCL›1870  LDA BDY,X›1880  STA YRW›1890  JSR CLR›1900  STA ALV,X›1910 ITD›1920  INX›1930  CPX # 32›1940  BNE IT›1950  JSR PCLR›1960  LDA # 8›1970  STA MNX›1980  LDA # 48›1990  STA MNY›2000  RTS›2010 ;›2020 ; Create random maze›2030 ;›2040 W›2050  JSR ITA›2060  LDA LVL›2070  SEC›2080  SBC # 1›2090  LSR A›2100  LSR A›2110  STA SPEED›2120  INC SPEED›2130  ASL A›2140  ASL A›2150  ASL A›2160  ASL A›2170  STA V1›2180  LDA # 6›2190  SEC›2200  SBC V1›2210  STA 709›2220  JSR PCLR›2230  LDA # 0›2240  STA KEY›2250  STA V6›2260  STA V3›2270  LDA 53770›2280  AND # 7›2290  STA V7›2300  LDA 53770›2310  AND # 7›2320  CLC›2330  ADC # 8›2340  STA V8›2350 W2›2360  LDX # 0›2370 W1›2380  STX XCL›2390  LDA V3›2400  STA YRW›2410  JSR X96›2420  LDA # 0›2430  STA (LOA),Y›2440  INX›2450  CPX # 64›2460  BNE W1›2470  INC V3›2480  LDA # 21›2490  CMP V3›2500  BNE W2›2510  LDX # 0›2520 W3›2530  LDA # 0›2540  STA YRW›2550  STX XCL›2560  JSR PTW›2570  LDA # 20›2580  STA YRW›2590  JSR PTW›2600  INX›2610  INX›2620  CPX # 62›2630  BNE W3›2640  LDX # 2›2650 W4›2660  LDA # 0›2670  STA XCL›2680  STX YRW›2690  JSR PTW›2700  LDA # 60›2710  STA XCL›2720  JSR PTW›2730  INX›2740  INX›2750  CPX # 20›2760  BNE W4›2770  LDA # 56›2780  STA XCL›2790  LDX # 2›2800 W49›2810  STX YRW›2820  JSR PTW›2830  INX›2840  INX›2850  CPX # 18›2860  BNE W49›2870  JSR GR›2880  LDA # 0›2890  STA XCL›2900  LDA # 4›2910  STA YRW›2920  JSR GR2›2930  LDA # 2›2940  STA XCL›2950  STA YRW›2960  JSR PTW›2970  LDA # 4›2980  STA XCL›2990  JSR PTW›3000  LDA # 0›3010  STA V5›3020  LDA # 4›3030  STA V4›3040 W43›3050  LDX # 4›3060 W45›3070  STX XCL›3080  LDA V4›3090  STA YRW›3100  LDA # 0›3110  STA V5›3120  JSR X96›3130  LDA (LOA),Y›3140  CMP # 0›3150  BEQ W46›3160  JMP W15›3170 W46›3180  JSR PTW›3190  LDA 53770›3200  AND # 3›3210  CMP # 3›3220  BNE W5›3230  DEC YRW›3240  DEC YRW›3250  JMP WUP›3260 W5›3270  CMP # 2›3280  BNE W6›3290  INC YRW›3300  INC YRW›3310  JMP WUP›3320 W6›3330  CMP # 1›3340  BNE W7›3350  DEC XCL›3360  DEC XCL›3370  JMP WLR›3380 W7›3390  INC XCL›3400  INC XCL›3410 WLR›3420  LDA XCL›3430  STA CLX›3440  LDA YRW›3450  STA RWY›3460  SEC›3470  SBC # 4›3480  STA YRW›3490  JSR X96›3500  LDA (LOA),Y›3510  CMP # 0›3520  BEQ W8›3530  INC V5›3540 W8›3550  LDY # 191›3560  LDA (LOA),Y›3570  CMP # 0›3580  BEQ W9›3590  INC V5›3600 W9›3610  LDY # 194›3620  LDA (LOA),Y›3630  CMP # 0›3640  BEQ W10›3650  INC V5›3660 W10›3670  LDA V5›3680  SEC›3690  CMP # 2›3700  BCC W11›3710  JMP W15›3720 W11›3730  LDA CLX›3740  STA XCL›3750  LDA RWY›3760  STA YRW›3770  JSR X96›3780  LDA (LOA),Y›3790  CMP # 0›3800  BEQ WGO›3810  JMP W15›3820 WGO›3830  LDA V6›3840  INC V6›3850  CMP V7›3860  BNE W30›3870  LDA # 175›3880  JMP W36›3890 W30›3900  CMP V8›3910  BNE W39›3920  LDA # 175›3930  JMP W36›3940 W39›3950  LDA 53770›3960  AND # 63›3970  SEC›3980  CMP LVL›3990  BCC W40›4000  JMP W32›4010 W40›4020  LDA # 167›4030 W36›4040  JSR W91›4050  JMP W15›4060 W91›4070  STA V5›4080  JSR X96›4090  LDA V5›4100  STA (LOA),Y›4110  LDY # 1›4120  INC V5›4130  LDA V5›4140  STA (LOA),Y›4150  LDY # 96›4160  INC V5›4170  LDA V5›4180  STA (LOA),Y›4190  LDY # 97›4200  INC V5›4210  LDA V5›4220  STA (LOA),Y›4230  RTS›4240 W32›4250  JSR PTW›4260  JMP W15›4270 WUP›4280  LDA XCL›4290  STA CLX›4300  DEC XCL›4310  DEC XCL›4320  LDA YRW›4330  STA RWY›4340  DEC YRW›4350  DEC YRW›4360  JSR X96›4370  LDA (LOA),Y›4380  CMP # 0›4390  BEQ W12›4400  INC V5›4410 W12›4420  LDY # 191›4430  LDA (LOA),Y›4440  CMP # 0›4450  BEQ W13›4460  INC V5›4470 W13›4480  LDY # 128›4490  INC HIA›4500  LDA (LOA),Y›4510  CMP # 0›4520  BEQ W14›4530  INC V5›4540 W14›4550  LDA V5›4560  SEC›4570  CMP # 2›4580  BCC W41›4590  JMP W15›4600 W41›4610  JMP W11›4620 W15›4630  INX›4640  INX›4650  INX›4660  INX›4670  CPX # 56›4680  BEQ W16›4690  JMP W45›4700 W16›4710  LDA V4›4720  CLC›4730  ADC # 4›4740  STA V4›4750  CMP # 20›4760  BEQ W20›4770  JMP W43›4780 W20›4790  LDA # 58›4800  STA XCL›4810  LDA # 6›4820  STA YRW›4830  LDA # 179›4840  JSR W91›4850  LDA # 8›4860  STA YRW›4870  LDA # 179›4880  JSR W91›4890  LDA # 56›4900  STA XCL›4910  LDA # 0›4920  STA YRW›4930  JSR GR2›4940  LDA # 58›4950  STA XCL›4960  LDA # 2›4970  STA YRW›4980  LDA LVL›4990  AND # 3›5000  CMP # 0›5010  BNE W17›5020  LDA # 232›5030  JMP W18›5040 W17›5050  LDA # 244›5060 W18›5070  JSR W91›5080  LDA LVL›5090  AND # 7›5100  CMP # 0›5110  BNE W19›5120  LDA # 10›5130  STA YRW›5140  LDA # 179›5150  JSR W91›5160  LDA # 54›5170  STA XCL›5180  LDA # 2›5190  STA YRW›5200  LDA # 175›5210  JSR W91›5220 W19›5230  RTS›5240 PTW›5250  JSR X96›5260  JSR LTW›5270  LDY # 0›5280  STA (LOA),Y›5290  JSR RTW›5300  LDY # 1›5310  STA (LOA),Y›5320  JSR RTW›5330  LDY # 96›5340  STA (LOA),Y›5350  JSR LTW›5360  LDY # 97›5370  STA (LOA),Y›5380  RTS›5390 LTW›5400  LDA 53770›5410  AND # 3›5420  CLC›5430  ADC # 1›5440  RTS›5450 RTW›5460  LDA 53770›5470  AND # 3›5480  CLC›5490  ADC # 5›5500  RTS›5510 X96›5520  LDA # 0›5530  STA V1›5540  STA V2›5550  STA HIA›5560  LDA YRW›5570  STA LOA›5580  LDY # 0›5590 L1›5600  LDA HIA›5610  ASL A›5620  STA HIA›5630  LDA LOA›5640  ASL A›5650  BCC L2›5660  INC HIA›5670  CLC›5680 L2›5690  STA LOA›5700  INY›5710  CPY # 5›5720  BNE L3›5730  LDA LOA›5740  STA V1›5750  LDA HIA›5760  STA V2›5770 L3›5780  CPY # 6›5790  BNE L1›5800  LDA HIA›5810  CLC›5820  ADC V2›5830  STA HIA›5840  LDA LOA›5850  CLC›5860  ADC V1›5870  BCC L4›5880  INC HIA›5890  CLC›5900 L4›5910  STA LOA›5920  LDA HIA›5930  CLC›5940  ADC # 64›5950  STA HIA›5960  LDA LOA›5970  CLC›5980  ADC XCL›5990  BCC L5›6000  INC HIA›6010 L5›6020  CLC›6030  ADC # 20›6040  BCC L6›6050  INC HIA›6060 L6›6070  STA LOA›6080  LDY # 0›6090  RTS›6100 ;›6110 ; Who can see man?›6120 ;›6130 ST›6140  JSR ST97›6150  LDA # 129›6160  STA V5›6170  DEC XCL›6180 ST2›6190  JSR ST99›6200  DEC XCL›6210  CMP # 0›6220  BEQ ST2›6230  LDA XCL›6240  STA V6›6250  JSR ST97›6260  LDA # 1›6270  STA V5›6280  INC XCL›6290 ST3›6300  JSR ST99›6310  INC XCL›6320  CMP # 0›6330  BEQ ST3›6340  LDA XCL›6350  STA V7›6360  JSR ST97›6370  LDA # 224›6380  STA V5›6390  DEC YRW›6400 ST4›6410  JSR ST99›6420  DEC YRW›6430  CMP # 0›6440  BEQ ST4›6450  LDA YRW›6460  STA V8›6470  JSR ST97›6480  LDA # 96›6490  STA V5›6500  INC YRW›6510 ST5›6520  JSR ST99›6530  INC YRW›6540  CMP # 0›6550  BEQ ST5›6560  LDA YRW›6570  STA V9›6580  RTS›6590 ST99›6600  LDA V5›6610  AND # 127›6620  STA V1›6630  LDA V5›6640  AND # 128›6650  CMP # 0›6660  BEQ Z1›6670  LDA LOA›6680  SEC›6690  SBC V1›6700  BCS Z2›6710  DEC HIA›6720 Z2›6730  STA LOA›6740  JMP Z4›6750 Z1›6760  LDA LOA›6770  CLC›6780  ADC V1›6790  BCC Z3›6800  INC HIA›6810 Z3›6820  STA LOA›6830 Z4›6840  LDY # 0›6850  LDA (LOA),Y›6860  INX›6870  CMP # 0›6880  BEQ ST98›6890  CMP # 55›6900  BEQ ST98›6910 ST96›6920  LDA # 1›6930  RTS›6940 ST98›6950  LDA # 0›6960  RTS›6970 ST97›6980  LDX # 0›6990  LDA XPOS›7000  STA XCL›7010  LDA YPOS›7020  STA YRW›7030  JSR X96›7040  RTS›7050 ;›7060 ; Set up Transporters›7070 ;›7080 GR›7090  LDA 53770›7100  AND # 3›7110  CLC›7120  ADC # 3›7130  ASL A›7140  ASL A›7150  STA XCL›7160  CLC›7170  ADC # 2›7180  STA GX1›7190  LDA 53770›7200  AND # 3›7210  ASL A›7220  ASL A›7230  STA YRW›7240  CLC›7250  ADC # 2›7260  STA GY1›7270  JSR GR2›7280  LDA 53770›7290  AND # 3›7300  CLC›7310  ADC # 9›7320  ASL A›7330  ASL A›7340  STA XCL›7350  CLC›7360  ADC # 2›7370  STA GX2›7380  LDA 53770›7390  AND # 3›7400  ASL A›7410  ASL A›7420  STA YRW›7430  CLC›7440  ADC # 2›7450  STA GY2›7460  JSR GR2›7470  RTS›7480 GR2›7490  LDA # 17›7500  JSR W91›7510  INC YRW›7520  INC YRW›7530  LDA # 9›7540  JSR W91›7550  DEC YRW›7560  DEC YRW›7570  INC XCL›7580  INC XCL›7590  LDA # 21›7600  JSR W91›7610  INC XCL›7620  INC XCL›7630  LDA # 25›7640  JSR W91›7650  INC YRW›7660  INC YRW›7670  LDA # 13›7680  JSR W91›7690  INC YRW›7700  INC YRW›7710  JSR PTW›7720  LDA XCL›7730  SEC›7740  SBC # 4›7750  STA XCL›7760  JSR PTW›7770  RTS›7780 ;›7790 ; VERTICAL BLANK›7800 ; (Used for smooth-scroll)›7810 ;›7820 INT›7830  LDY # VBK&255›7840  LDX # VBK/256›7850  LDA # 6›7860  JSR SEVBV›7870 INT2›7880  LDX # 0›7890  LDA # 157›7900 AGN2›7910  STA SCRS,X›7920  INX›7930  CPX # 7›7940  BNE AGN2›7950  LDA # 51   ›7960  STA HIC›7970  RTS›7980 VBK›7990  LDA # 64›8000  STA DHI›8010  LDA MNX›8020  LSR A›8030  LSR A›8040  AND # 254›8050  STA DLO›8060  LDY # 4›8070 AGN›8080  LDA DLO›8090  STA DLIST,Y›8100  INY›8110  LDA DHI›8120  STA DLIST,Y›8130  LDA DLO›8140  CLC›8150  ADC # 96›8160  BCC NXT›8170  INC DHI›8180 NXT›8190  STA DLO›8200  INY›8210  INY›8220  CPY # 70›8230  BNE AGN›8240  LDA MNX›8250  AND # 7›8260  EOR # 7›8270  STA 54276›8280  JMP SYSVBV›8290 FND›8300  JSR FND1A›8310 FND1A›8320  STA V3›8330  AND # 12›8340  CMP # 0›8350  BNE FND1›8360  JMP FND3›8370 FND1›8380  CMP # 8›8390  BNE FND2›8400  INC XCL›8410 FND2›8420  CMP # 4›8430  BNE FND5›8440  DEC XCL›8450  JMP FND5›8460 FND3›8470  LDA V3›8480  AND # 3›8490  CMP # 2›8500  BNE FND4›8510  INC YRW›8520 FND4›8530  CMP # 1›8540  BNE FND5›8550  DEC YRW›8560 FND5›8570  LDA V3›8580  RTS›8590 REVERS›8600  STA V3›8610  AND # 12›8620  CMP # 0›8630  BEQ RVS1›8640  EOR # 12›8650 RVS1›8660  STA V1›8670  LDA V3›8680  AND # 3›8690  CMP # 0›8700  BEQ RVS2›8710  EOR # 3›8720 RVS2›8730  CLC›8740  ADC V1›8750  RTS›8760 PLY›8770  LDA # 8›8780  STA SNGX›8790  RTS›8800 ;›8810 ; Found Treasure!›8820 ;›8830 FDT›8840  JSR PLY›8850  LDX # 168›8860  STX PLAY›8870  LDX # 192›8880  STX LOC›8890  LDX # 4›8900  JSR SCR›8910  LDA # 171›8920  JSR W91›8930  LDA # 171›8940  RTS›8950 ;›8960 ; Found Key!›8970 ;›8980 FDK›8990  LDA KEY›9000  CMP # 1›9010  BNE FDL›9020  RTS›9030 FDL›9040  JSR PLY›9050  LDX # 168›9060  STX PLAY›9070  LDX # 208›9080  STX LOC›9090  LDA # 1›9100  STA KEY›9110  JSR CLR›9120  LDA # 0›9130  RTS›9140 ;›9150 ; Found Keyhole!›9160 ;›9170 FDH›9180  LDA KEY›9190  CMP # 0›9200  BEQ FDI›9210  JSR PLY›9220  LDX # 168›9230  STX PLAY›9240  LDX # 200›9250  STX LOC›9260  LDA # 0›9270  STA KEY›9280  JSR CLR›9290  LDA # 0›9300  RTS›9310 FDI›9320  LDA # 171›9330  RTS›9340 ;›9350 ; Release Prisoner›9360 ;›9370 FDP›9380  JSR PLY›9390  LDX # 168›9400  STX PLAY›9410  LDX # 224›9420  STX LOC›9430  JSR CLR›9440  LDX # 3›9450  JSR SCR›9460  LDA # 0›9470  STA XCL›9480  LDA # 2›9490  STA YRW›9500  JSR GR2›9510  LDA # 2›9520  STA XCL›9530  LDA # 4›9540  STA YRW›9550  LDA # 244›9560  JSR W91›9570  LDA # 0›9580  RTS›9590 ;›9600 ; Clear Location›9610 ;›9620 CLR›9630  JSR X96›9640  LDA # 0›9650  STA (LOA),Y›9660  LDY # 1›9670  STA (LOA),Y›9680  LDY # 96›9690  STA (LOA),Y›9700  LDY # 97›9710  STA (LOA),Y›9720  RTS›9730 ;›9740 ; Handle Score›9750 ;›9760 SCR›9770  LDA # 1›9780  STA V1›9790 SCR1›9800  LDA V1›9810  CMP # 1›9820  BNE SCR3›9830  CPX # 2›9840  BNE SCR4›9850  INC LIVES›9860  STX V1›9870  JSR ITF›9880  JSR PLY›9890  LDA # 224›9900  STA LOC›9910  LDA # 168›9920  STA PLAY›9930  LDX V1›9940 SCR4›9950  LDA # 0›9960  STA V1›9970  LDA SCRS,X›9980  CLC›9990  ADC # 1›010000  CMP # 167›010010  BNE SCR2›010020  LDA # 157›010030  INC V1›010040 SCR2›010050  STA SCRS,X›010060 SCR3›010070  DEX›010080  CPX # 255›010090  BNE SCR1›010100  RTS›010110 ;›010120 ; Move Man Around›010130 ;›010140 MN›010150  LDA # 146›010160  STA V1›010170  LDA NOW›010180  SEC›010190  CMP # 128›010200  BCC ZX›010210  LDA # 68›010220  STA V1›010230 ZX›010240  LDA 20›010250  AND # 7›010260  CLC›010270  ADC V1›010280 ZZ›010290  STA 708›010300  LDA 54016›010310  AND # 12›010320  EOR # 12›010330  CMP # 0›010340  BEQ MN1›010350  STA STK›010360  JMP MN2›010370 MN1›010380  LDA 54016›010390  AND # 3›010400  EOR # 3›010410  STA STK›010420 MN2›010430  LDA MNX›010440  LSR A›010450  LSR A›010460  AND # 254›010470  STA XPOS›010480  LDA MNX›010490  AND # 7›010500  CMP # 0›010510  BEQ MN3›010520  JMP MN14›010530 MN3›010540  LDA MNY›010550  LSR A›010560  LSR A›010570  LSR A›010580  AND # 254›010590  STA YPOS›010600  LDA MNY›010610  AND # 15›010620  CMP # 0›010630  BEQ MN4›010640  JMP MN14›010650 MN4›010660  LDA TRGR›010670  CMP # 0›010680  BEQ MN7›010690  LDA STK›010700  CMP # 0›010710  BEQ MN7›010720  LDA XPOS›010730  STA XCL›010740  LDA YPOS›010750  STA YRW›010760  LDA STK›010770  JSR FND›010780  JSR X96›010790  LDA (LOA),Y›010800  CMP # 167›010810  BNE MN5›010820  JSR FDT›010830 MN5›010840  CMP # 175›010850  BNE MN6›010860  JSR FDK›010870 MN6›010880  CMP # 0›010890  BEQ MNA›010900  SEC›010910  CMP # 52›010920  BCC MN7›010930  CMP # 171›010940  BEQ MN7›010950 MNA›010960  LDA STK›010970  STA MVE›010980 MN7›010990  LDA XPOS›011000  STA XCL›011010  LDA YPOS›011020  STA YRW›011030  LDA MVE›011040  JSR FND›011050  JSR X96›011060  LDA (LOA),Y›011070  CMP # 167›011080  BNE MN8›011090  JSR FDT›011100 MN8›011110  CMP # 175›011120  BNE MN9›011130  JSR FDK›011140 MN9›011150  CMP # 179›011160  BNE MN10›011170  JSR FDH›011180 MN10›011190  CMP # 244›011200  BNE MN11›011210  INC OVER›011220 MN11›011230  CMP # 232›011240  BNE MN11A›011250  JSR FDP›011260 MN11A›011270  CMP # 0›011280  BEQ MN13›011290  SEC›011300  CMP # 52›011310  BCC MN12›011320  CMP # 171›011330  BEQ MN12›011340  JMP MN13›011350 MN12›011360  LDA # 0›011370  STA MVE›011380 MN13›011390  LDA MNX›011400  STA XCL›011410  LDA MNY›011420  STA YRW›011430  LDA MVE›011440  JSR FND1A›011450  LDA XCL›011460  STA MNX›011470  LDA YRW›011480  STA MNY›011490  JMP SW›011500 MN14›011510  LDA TRGR›011520  CMP # 0›011530  BEQ MN13›011540  LDA STK›011550  CMP # 0›011560  BNE MN15›011570  JMP MN13›011580 MN15›011590  LDA MVE›011600  JSR REVERS›011610  CMP STK›011620  BNE MN16›011630  LDA STK›011640  STA MVE›011650 MN16›011660  JMP MN13›011670 ;›011680 ; Display Man on screen›011690 ;›011700 SW›011710  LDA MVE›011720  CMP # 0›011730  BEQ SW4›011740  LDA SHOMN›011750  AND # 128›011760  CMP # 0›011770  BEQ SW2›011780  LDA SHOMN›011790  CLC›011800  ADC # 18›011810  CMP # 218›011820  BNE SW1›011830  LDA # 72›011840 SW1›011850  STA SHOMN›011860  JMP SW4›011870 SW2›011880  LDA SHOMN›011890  SEC›011900  SBC # 18›011910  CMP # 238›011920  BNE SW3›011930  LDA # 128›011940 SW3›011950  STA SHOMN›011960 SW4›011970  LDA # 32›011980  STA LOA›011990  LDA # 60›012000  STA HIA›012010  LDA MVE›012020  CMP # 8›012030  BNE SW5›012040  LDA # 96›012050  STA LO›012060  LDA # 55   ›012070  STA HI›012080 SW5›012090  CMP # 4›012100  BNE SW6›012110  LDA # 0›012120  STA LO›012130  LDA # 52›012140  STA HI›012150 SW6›012160  CMP # 2›012170  BNE SW7›012180 SW6A›012190  LDA # 32›012200  STA LO›012210  LDA # 53   ›012220  STA HI›012230 SW7›012240  CMP # 1›012250  BNE SW8›012260  LDA # 64›012270  STA LO›012280  LDA # 54   ›012290  STA HI›012300 SW8›012310  CMP # 0›012320  BNE SW9›012330  JMP SW6A›012340 SW9›012350  LDA SHOMN›012360  AND # 127›012370  CLC›012380  ADC LO›012390  BCC SW10›012400  INC HI›012410 SW10›012420  STA LO›012430  LDA LOA›012440  CLC›012450  ADC MNY›012460  BCC SW11›012470  INC HIA›012480 SW11›012490  STA LOA›012500  LDX # 0›012510 SW12›012520  LDY # 0›012530 SW13›012540  LDA (LO),Y›012550  STA (LOA),Y›012560  INY›012570  CPY # 18›012580  BNE SW13›012590  LDA LO›012600  CLC›012610  ADC # 90›012620  BCC SW14›012630  INC HI›012640 SW14›012650  STA LO›012660  INC HIA›012670  INX›012680  CPX # 3›012690  BNE SW12›012700  RTS›012710 PCLR›012720  LDA # 32›012730  STA LOA›012740  LDA # 60›012750  STA HIA›012760  LDX # 0›012770  STX 53278›012780 PC1›012790  LDY # 0›012800  LDA # 0›012810 PC2›012820  STA (LOA),Y›012830  INY›012840  CPY # 170›012850  BNE PC2›012860  INC HIA›012870  INX›012880  CPX # 3›012890  BNE PC1›012900  RTS›012910 ;›012920 ; Move Monsters Around›012930 ;›012940 H›012950  LDA # 0›012960  STA V4›012970  LDA BDX,X›012980  SEC›012990  CMP MNXA›013000  BCC H1›013010  SEC›013020  SBC MNXA›013030  STA V1›013040  LDA # 4›013050  STA TXY›013060  JMP H2›013070 H1›013080  LDA MNXA›013090  SEC›013100  SBC BDX,X›013110  STA V1›013120  LDA # 8›013130  STA TXY›013140 H2›013150  LDA BDY,X›013160  SEC›013170  CMP MNYA›013180  BCC H3›013190  SEC›013200  SBC MNYA›013210  STA V2›013220  LDA TXY›013230  CLC›013240  ADC # 1›013250  STA TXY›013260  JMP H4›013270 H3›013280  LDA MNYA›013290  SEC›013300  SBC BDY,X›013310  STA V2›013320  LDA TXY›013330  CLC›013340  ADC # 2›013350  STA TXY›013360 H4›013370  LDA V2›013380  SEC›013390  CMP V1›013400  BCS H8›013410 H5›013420  LDA # 12›013430  STA V5›013440  JSR CK›013450  CMP # 1›013460  BNE H6›013470  JMP H11›013480 H6›013490  LDA # 3›013500  STA V5›013510  JSR CK›013520  CMP # 1›013530  BNE H7›013540  JMP H11›013550 H7›013560  LDA TXY›013570  JSR REVERS›013580  STA TXY›013590 H8›013600  LDA # 3›013610  STA V5›013620  JSR CK›013630  CMP # 1›013640  BNE H9›013650  JMP H11›013660 H9›013670  LDA # 12›013680  STA V5›013690  JSR CK›013700  CMP # 1›013710  BNE H10›013720  JMP H11›013730 H10›013740  LDA TXY›013750  JSR REVERS›013760  STA TXY›013770  JMP H5›013780 H11›013790  LDA BDX,X›013800  STA XCL›013810  LDA BDY,X›013820  STA YRW›013830  LDA BDXY,X›013840  JSR FND1A›013850  LDA XCL›013860  STA BDX,X›013870  LDA YRW›013880  STA BDY,X›013890  RTS›013900 RANDOM›013910  LDA # 0›013920  STA V4›013930  LDA 53770›013940  AND # 3›013950  CMP # 0›013960  BNE RM1›013970  LDY # 5›013980 RM1›013990  CMP # 1›014000  BNE RM2›014010  LDY # 9›014020 RM2›014030  CMP # 2›014040  BNE RM3›014050  LDY # 6›014060 RM3›014070  CMP # 3›014080  BNE RM4›014090  LDY # 10›014100 RM4›014110  STY TXY›014120  LDA 53770›014130  AND # 1›014140  CMP # 0›014150  BEQ RM5›014160  JMP H5›014170 RM5›014180  JMP H8›014190 CK›014200  LDA # 0›014210  STA JUMP›014220  INC V4›014230  LDA # 4›014240  SEC›014250  CMP V4›014260  BCC CK1›014270  LDA BDXY,X›014280  JSR REVERS›014290  STA V3›014300  LDA TXY›014310  AND V5›014320  CMP V3›014330  BEQ CK2›014340 CK1›014350  LDA BDX,X›014360  STA XCL›014370  LDA BDY,X›014380  STA YRW›014390  LDA TXY›014400  AND V5›014410  JSR FND›014420  JSR X96›014430  LDA (LOA),Y›014440  CMP # 0›014450  BEQ C3›014460  SEC›014470  CMP # 166›014480  BCC CA›014490  SEC›014500  CMP # 193›014510  BCC CK2›014520 CA›014530  SEC›014540  CMP # 55›014550  BCC CK2›014560  SEC›014570  CMP # 231›014580  BCS CK2›014590 C3›014600  LDA # 1›014610  STA JUMP›014620  LDA TXY›014630  AND V5›014640  STA BDXY,X›014650 CK2›014660  LDA JUMP›014670  RTS›014680 BT›014690  LDA # 0›014700  STA CNTR›014710  LDX XCNT›014720 B1›014730  LDA ALV,X›014740  CMP # 0›014750  BNE BT1›014760  LDA 53770›014770  SEC›014780  CMP LVL›014790  BCC B1A›014800  JMP B12›014810 B1A›014820  LDA NOW›014830  SEC›014840  CMP # 128›014850  BCS B1T›014860  JMP B12›014870 B1T›014880  LDA 53770›014890  AND # 1›014900  CMP # 1›014910  BEQ BT0›014920  LDA GX1›014930  STA BDX,X›014940  LDA GY1›014950  STA BDY,X›014960 BTA›014970  LDA LVL›014980  AND 53770›014990  AND # 3›015000  CLC›015010  ADC # 1›015020  STA ALV,X›015030  JMP BT1›015040 BT0›015050  LDA GX2›015060  STA BDX,X›015070  LDA GY2›015080  STA BDY,X›015090  JMP BTA›015100 BT1›015110  LDA BDY,X›015120  STA YRW›015130  LDA BDX,X›015140  STA XCL›015150  JSR CLR›015160  LDA BDX,X›015170  AND # 1›015180  CMP # 0›015190  BEQ BT2›015200  JMP B14›015210 BT2›015220  LDA BDY,X›015230  AND # 1›015240  CMP # 0›015250  BEQ BT3›015260  JMP B14›015270 ;›015280 ; If Monster can see Man,›015290 ; have all Monsters find›015300 ; their way to where Man›015310 ; was seen last.›015320 ;›015330 BT3›015340  LDA BDX,X›015350  CMP XPOS›015360  BNE BT5›015370  LDA BDY,X›015380  SEC›015390  CMP V8›015400  BCC BT5›015410  SEC›015420  CMP V9›015430  BCS BT5›015440  LDA YPOS›015450  SEC›015460  CMP BDY,X›015470  BCC BT6›015480  LDA BDXY,X›015490  CMP # 1›015500  BEQ BT5›015510  JMP B7›015520 BT6›015530  LDA BDXY,X›015540  CMP # 2›015550  BEQ BT5›015560 B7›015570  LDA # 1›015580  STA SPOT›015590  STA SPOT2›015600  LDY # 0›015610  LDA # 1›015620 BT4›015630  STA BDG,Y›015640  INY›015650  CPY # 32›015660  BNE BT4›015670  JMP B9›015680 BT5›015690  LDA BDY,X›015700  CMP YPOS›015710  BNE B9›015720  LDA BDX,X›015730  SEC›015740  CMP V6›015750  BCC B9›015760  SEC›015770  CMP V7›015780  BCS B9›015790  LDA XPOS›015800  SEC›015810  CMP BDX,X›015820  BCC B8›015830  LDA BDXY,X›015840  CMP # 4›015850  BEQ B9›015860  JMP B7›015870 B8›015880  LDA BDXY,X›015890  CMP # 8›015900  BEQ B9›015910  JMP B7›015920 B9›015930  LDA BDX,X›015940  CMP MNXA›015950  BNE B10›015960  LDA BDY,X›015970  CMP MNYA›015980  BNE B10›015990  LDA # 0›016000  STA BDG,X›016010 B10›016020  LDA SPOT›016030  CMP # 0›016040  BEQ B10A›016050  LDA SPOT2›016060  STA SPOT›016070  LDA XPOS›016080  STA MNXA›016090  LDA YPOS›016100  STA MNYA›016110 B10A›016120  LDA BDG,X›016130  CMP # 1›016140  BNE B11›016150  JSR H›016160  JMP B12›016170 B11›016180  JSR RANDOM›016190 B12›016200  LDA # 0›016210  STA V2›016220 B12A›016230  LDA ALV,X›016240  CMP # 0›016250  BEQ B15›016260  CMP # 1›016270  BNE B16›016280  LDA # 56›016290  JMP B20›016300 B16›016310  CMP # 2›016320  BNE B17›016330  LDA # 200›016340  JMP B20›016350 B17›016360  LDA # 216›016370 B20›016380  STA V1›016390  LDA BDXY,X›016400  AND # 8›016410  CMP # 8›016420  BNE B21›016430  LDA V1›016440  CLC›016450  ADC # 4›016460  STA V1›016470 B21›016480  LDA BDX,X›016490  STA XCL›016500  LDA BDY,X›016510  STA YRW›016520  LDA V1›016530  CLC›016540  ADC V2›016550  JSR W91›016560 B15›016570  INX›016580  CPX # 32›016590  BNE BAZ›016600  LDX # 0›016610  STX SPOT2›016620 BAZ›016630  INC CNTR›016640  LDA # 8›016650  CMP CNTR›016660  BEQ B13›016670  JMP B1›016680 B13›016690  STX XCNT›016700  RTS›016710 B14›016720  JSR H11›016730  LDA # 8›016740  STA V2›016750  JMP B12A›016760 ;›016770 ; SHOOT›016780 ;›016790 SHT›016800  LDA 54016›016810  LSR A›016820  LSR A›016830  LSR A›016840  LSR A›016850  STA V1›016860  AND # 12›016870  EOR # 12›016880  CMP # 0›016890  BEQ SHTB›016900  STA STK1›016910  JMP S1›016920 SHTB›016930  LDA V1›016940  AND # 3›016950  EOR # 3›016960  CMP # 0›016970  BEQ SHTA›016980  STA STK1›016990  JMP S1›017000 SHTA›017010  LDA STK›017020  STA STK1›017030  LDA 53264›017040  STA TRGR›017050  CMP # 0›017060  BEQ S1›017070  LDA BLTXY›017080  CMP # 0›017090  BNE S3›017100  RTS›017110 S1›017120  LDA BLTXY›017130  CMP # 0›017140  BEQ S2›017150  JMP S3›017160 S2›017170  LDA STK1›017180  CMP # 0›017190  BNE S2A›017200  RTS›017210 S2A›017220  LDA XPOS›017230  STA BLTX›017240  LDA YPOS›017250  STA BLTY›017260  LDA STK1›017270  STA BLTXY›017280  JSR PLY›017290  LDA # 192›017300  STA LOC›017310  LDA # 136›017320  STA PLAY›017330 S3›017340  LDA BLTX›017350  STA XCL›017360  LDA BLTY›017370  STA YRW›017380  JSR X96›017390  LDA # 0›017400  STA (LOA),Y›017410  LDA BLTXY›017420  JSR FND1A›017430  JSR X96›017440  LDA (LOA),Y›017450  CMP # 0›017460  BEQ S4›017470  LDA # 0›017480  STA BLTXY›017490  JMP S45›017500 S4›017510  LDA # 55›017520  STA (LOA),Y›017530  LDA XCL›017540  STA BLTX›017550  LDA YRW›017560  STA BLTY›017570 S45›017580  LDY # 0›017590  LDA XCL›017600  STA CLX›017610  LDA YRW›017620  STA RWY›017630 S5›017640  LDA CLX›017650  STA XCL›017660  LDA RWY›017670  STA YRW›017680  LDA BDX,Y›017690  STA V1›017700  LDA XCL›017710  CMP V1›017720  BEQ S5A›017730  SEC›017740  SBC # 1›017750  CMP V1›017760  BNE S6›017770 S5A›017780  LDA BDY,Y›017790  STA V1›017800  LDA YRW›017810  CMP V1›017820  BEQ S5B›017830  SEC›017840  SBC # 1›017850  CMP V1›017860  BNE S6›017870 S5B›017880  LDA ALV,Y›017890  CMP # 0›017900  BEQ S6›017910  LDA # 0›017920  STA ALV,Y›017930  JSR PLY›017940  LDA # 136›017950  STA PLAY›017960  LDA # 216›017970  STA LOC›017980  LDX # 6›017990  JSR SCR›018000  LDA BDX,Y›018010  STA XCL›018020  LDA BDY,Y›018030  STA YRW›018040  STY V5›018050  JSR CLR›018060  LDY V5›018070 S6›018080  INY›018090  CPY # 32›018100  BNE S5›018110  RTS›018120 ;›018130 ; Check speed to determine›018140 ; when to move the Monsters›018150 ;›018160 Q›018170  LDA TIMES›018180  CLC›018190  ADC SPEED›018200  STA TIMES›018210  SEC›018220  CMP # 11›018230  BCS Q1›018240  RTS›018250 Q1›018260  SEC›018270  SBC # 12›018280  STA TIMES›018290  JSR ST›018300  JSR BT›018310  RTS›018320 LP›018330  JSR INT2›018340  JSR W›018350  LDA # 157›018360  STA SCRS+10›018370  STA SCRS+11›018380  LDA # 3›018390  STA LIVES›018400  LDX # 11›018410  JSR SCR›018420  JSR ITA›018430  LDA # 0›018440  STA 53278›018450 ;›018460 ; MAIN CONTROL LOOP OF PROGRAM›018470 ;›018480 LP2›018490  LDA 53253›018500  AND # 6›018510  CMP # 0›018520  BEQ LP5›018530  DEC LIVES›018540  LDA # 138›018550  STA 53761›018560  STA 20›018570 LPT›018580  LDA 20›018590  STA 53760›018600  CMP # 255›018610  BNE LPT›018620  LDA # 0›018630  STA 53761›018640  CMP LIVES›018650  BNE LP6›018660  LDX # 0›018670 LPQ›018680  LDA SCRS,X›018690  SEC›018700  SBC # 13›018710  STA 14599,X›018720  INX›018730  CPX # 7›018740  BNE LPQ›018750  JSR PCLR›018760  LDA # 224›018770  STA 756›018780  LDA # 71›018790  STA 560›018800  LDA # 34›018810  STA 561›018820  LDA # 0›018830  STA 708›018840  STA 19›018850  STA 709›018860 LPR›018870  LDA 19›018880  CMP # 3›018890  BNE LPR›018900  RTS›018910 LP6›018920  JSR ITA›018930 LP5›018940  JSR MN›018950  INC NOW›018960  LDA # 0›018970  STA 77›018980  STA 53278›018990  LDA 20›019000  SEC›019010  CMP # 8›019020  BCC Q9›019030  LDA # 0›019040  STA 20›019050  LDY SNGX›019060  CPY # 0›019070  BEQ Q9›019080  DEY›019090  STY SNGX›019100  LDA (LOC),Y›019110  STA 53760›019120  LDX PLAY›019130  DEX›019140  STX PLAY›019150  STX 53761›019160 Q9›019170  JSR SHT›019180  JSR Q›019190  JSR Q›019200  LDX # 32›019210 LP4›019220  LDY # 32›019230 LP3›019240  DEY›019250  CPY SPEED›019260  BNE LP3›019270  DEX›019280  CPX SPEED›019290  BNE LP4›019300  LDA OVER›019310  CMP # 0›019320  BEQ LP1›019330  INC LVL›019340  LDX # 11›019350  JSR SCR›019360  LDA # 0›019370  STA 559›019380  JSR W›019390  LDA LVL›019400  AND # 3›019410  CMP # 1›019420  BNE LPJ›019430  LDA # 170›019440  STA 53761›019450  LDA # 232›019460  STA LOC›019470  LDY # 0›019480  STY SNGX›019490 LPH›019500  LDA # 0›019510  STA 20›019520  LDA (LOC),Y›019530  STA 53760›019540 LPI›019550  LDA 20›019560  CMP # 10›019570  BNE LPI›019580  INY›019590  CPY # 21›019600  BNE LPH›019610 LPJ›019620  LDA # 126›019630  STA 559›019640  LDX # 3›019650  JSR SCR›019660 LP1›019670  JMP LP2›019680 ;›019690 ; The Display List›019700 ; starts at: $2FB4.›019710 ;›019720 ; A redefined Character›019730 ; Set starts at: $3000.›019740 ;›019750 ; Miscellaneous data fills›019760 ; locations $33C0 through›019770 ; $3881.›019780 ;›019790 ; PMBASE is located at $3800.›019800 ;›019810 ; The Action Screen is›019820 ; located at $4000.›019830 ;›019840  .END›